import http from "../utils/request";
// 数据清洗接口

// 算法升级模块其下的接口~~~~~~~~~~~~
// 算法导入
export function sfsjDaoruApi(data) {
  return http({
    url: `underwater-sound/algorithmManagement/addAlgorithm`,
    method: "post",
    data: data,
    headers: {
      "Content-Type": "multipart/form-data", //重点：设置请求头
    },
  });
}

// 算法编辑的
export function sfsjEditApi(data) {
  return http({
    url: `underwater-sound/algorithmManagement/updateAlgorithm`,
    method: "post",
    data: data,
    headers: {
      "Content-Type": "multipart/form-data", //重点：设置请求头
    },
  });
}

// 上架下架判断
export function sfsjOnlineOrOfflineApi(query) {
  return http({
    url: `underwater-sound/algorithmManagement/checkSameTypeAlgorithmIsOnline`,
    method: "get",
    params: query,
  });
}

// 算法的list
export function sfsjTableListApi(data) {
  return http({
    url: `underwater-sound/algorithmManagement/queryAlgorithmsByType`,
    method: "post",
    data: data,
  });
}

// 删除算法的item
export function sfsjTableDelItemApi(data) {
  return http({
    url: `underwater-sound/algorithmManagement/delAlgorithm/${data}`,
    method: "post",
  });
}

// 元数据提取模块下的接口~~~~~~~~~~~~~~~~
// 获取导入文件的Table
// export function ysjtqGetDaoruTableListApi(query) {
//   return http({
//     url: `underwater-sound/dataTableEntity/getDataTableByType`,
//     method: "get",
//     params: query,
//   });
// }
// 5月21日新添加接口
export function ysjtqGetDaoruTableListApi(query) {
  return http({
    url: `underwater-sound/dataTableEntity/getDataTableByDataColumn`,
    method: "get",
    params: query,
  });
}
// 获取文件类型
export function ysjtqGetFileTypeApi(type) {
  return http({
    url: `underwater-sound/dataTypeEntity/getDataTypeTree/${type}`,
    method: "get",
  });
}

// 导入文件弹窗 勾选 后 的接口调用
export function ysjtqDaoruDialogCheckTableItemApi(data) {
  return http({
    url: `underwater-sound/metadataExtraction/importTable`,
    method: "post",
    data: data,
  });
}

// 查询数据分页表头/
export function ysjtqGetTableHeaderRowApi(query) {
  return http({
    url: `underwater-sound/metadataExtraction/queryDataTableColumn`,
    method: "get",
    params: query,
  });
}

// 获取表单数据
export function ysjtqGetTableListDataApi(query) {
  return http({
    url: `underwater-sound/metadataExtraction/queryTableDataList`,
    method: "get",
    params: query,
  });
}

// 修改表头
export function ysjtqShujuTableHeaderValueApi(data) {
  return http({
    url: `underwater-sound/metadataExtraction/updateTableHead`,
    method: "post",
    data: data,
  });
}

// 勾选数据导出到本地
export function ysjtqCheckItemDaochuLocationApi(data) {
  return http({
    url: `underwater-sound/metadataExtraction/downloadData`,
    method: "post",
    data: data,
    responseType: "blob",
  });
}

// 清空左侧树
export function ysjtqClearLeftTreeListApi() {
  return http({
    url: `underwater-sound/metadataExtraction/cleanAll`,
    method: "get",
  });
}

// 获取左侧树结构
export function ysjtqGetLeftListApi() {
  return http({
    url: `underwater-sound/metadataExtraction/queryImportTable`,
    method: "get",
  });
}

// 获取右侧上面的数据table
export function ysjtqGetTableListApi(query) {
  return http({
    url: `underwater-sound/fileExtractEntity/getExtractRawDataList`,
    method: "get",
    params: query,
  });
}

// 删除数据
export function ysjtqRemoveTableItemApi(query) {
  return http({
    url: `underwater-sound/metadataExtraction/deleteData`,
    method: "get",
    params: query,
  });
}

// 获取元数据摘取弹窗中的list的接口
export function ysjtqGetZhaiquDialogListApi() {
  return http({
    url: `underwater-sound/metadataDictyTable/getAllTree`,
    method: "get",
  });
}

// 元数据摘取
export function ysjtqShujuZhaiquApi(data) {
  return http({
    url: `underwater-sound/metadataExtraction/executeDataExtraction`,
    method: "post",
    data: data,
  });
}

// 获取tree的二级
export function ysjtqGetDaochuShujukuTree2Api(query) {
  return http({
    url: `underwater-sound/dataTableEntity/getDataTableByType`,
    method: "get",
    params: query,
  });
}

// 摘取导出到本地
export function ysjtqDaochuZhaiquShujuDataApi(data) {
  return http({
    url: `underwater-sound/fileExtractEntity/downloadDataExtraction`,
    method: "post",
    data: data,
    responseType: "blob",
  });
}

// 摘取导出到表地
export function ysjtqDaochuZhaiquShujuGoBiaoDataApi(data) {
  return http({
    url: `underwater-sound/dataTableEntity/importResultDataToDatabase`,
    method: "post",
    data: data,
  });
}

// 摘取导出到新表
export function ysjtqDaochuZhaiquShujuGoNewBiaoDataApi(data) {
  return http({
    url: `underwater-sound/dataTableEntity/createTableByExtractIds`,
    method: "post",
    data: data,
  });
}

// 数据修改
export function ysjtqShujuEditItemApi(data) {
  return http({
    url: `underwater-sound/excelDataExtractEntity/updateDataById`,
    method: "post",
    data: data,
  });
}
// 数据删除
export function ysjtqShujuDelItemApi(query) {
  return http({
    url: `underwater-sound/excelDataExtractEntity/removeByIdRecord?extractId=${query}`,
    method: "get",
  });
}
// 摘取修改
export function ysjtqZhaiquEditItemApi(data) {
  return http({
    url: `underwater-sound/extractDataEntity/updateDataById`,
    method: "post",
    data: data,
  });
}
// 摘取删除
export function ysjtqZhaiquDelItemApi(query) {
  return http({
    url: `underwater-sound/extractDataEntity/removeByIdRecord?extractId=${query}`,
    method: "get",
  });
}

export function importTable(data) {
  return http({
    url: `underwater-sound/dataFilterAndFusion/importTable`,
    method: "post",
    data: data,
  });
}

export function queryImportTable() {
  return http({
    url: `underwater-sound/dataFilterAndFusion/queryImportTable`,
    method: "get",
  });
}

/*.
* 获取导入的表结构
  {importDataTableId: id}
* */
export function queryDataTableColumn(id) {
  return http({
    url: `underwater-sound/dataFilterAndFusion/queryDataTableColumn?importDataTableId=${id}`,
    method: "get",
  });
}
export function filterImportTableData(currPage, pageSize, data) {
  return http({
    url: `underwater-sound/dataFilterAndFusion/filterImportTableData?pageNum=${currPage}&pageSize=${pageSize}`,
    method: "post",
    data: data,
  });
}
export function dataFusion(data) {
  return http({
    url: `underwater-sound/dataFilterAndFusion/dataFusion`,
    method: "post",
    data: data,
  });
}
export function rongheDownloadData(data) {
  return http({
    url: `underwater-sound/dataFilterAndFusion/downloadData`,
    method: "post",
    data: data,
    responseType: "blob",
  });
}

export function queryFusionHis() {
  return http({
    url: `underwater-sound/dataFilterAndFusion/queryFusionHis`,
    method: "get",
  });
}
export function queryCorrelationJudgmentHis() {
  return http({
    url: `underwater-sound/correlationJudgment/queryCorrelationJudgmentHis`,
    method: "get",
  });
}
export function queryCorrelationJudgmentHisDetails(params) {
  return http({
    url:
      `underwater-sound/correlationJudgment/queryCorrelationJudgmentHisDetails?correlationJudgmentId=` +
      params,
    method: "get",
  });
}
// 筛选融合  一键清空
export function cleanAllData() {
  return http({
    url: `underwater-sound/dataFilterAndFusion/cleanAllData`,
    method: "get",
  });
}
// 筛选融合 列表编辑弹框提交 post请求，参数为对象，修改按钮
export function sxupdateData(data) {
  return http({
    url: `underwater-sound/dataFilterAndFusion/updateImportTableData`,
    method: "post",
    data: data,
  });
}
//筛选融合 列表删除 Post请求 参数为：请求体中是一个数组 例如[id]  删除按钮
export function sxdeleteData(data) {
  return http({
    url: `underwater-sound/dataFilterAndFusion/deleteTableData`,
    method: "post",
    data: data,
  });
}

// 关联判证下的接口~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// 导入弹窗的级联数据
export function glpzGetDaoruCascaderApi() {
  return http({
    url: `underwater-sound/correlationJudgment/querySpecifiedDataType`,
    method: "get",
  });
}
// 获取选择表下的数据
export function glpzGetDaoruTableDataApi(query) {
  return http({
    url: `underwater-sound/dataEntity/findList`,
    method: "get",
    params: query,
  });
}
// 获取选择表下的列名数据
export function glpzGetDaoruTableRowApi(query) {
  return http({
    url: `underwater-sound/dataColumnEntity/selectByTableId`,
    method: "get",
    params: query,
  });
}
// 导入文件的确认导入
export function glpzDaoruSubmitApi(data) {
  return http({
    url: `underwater-sound/correlationJudgment/importTable`,
    method: "post",
    data: data,
  });
}

// 查询左侧树结构数据 --2级
export function glpzGetLeftTreeData222Api() {
  return http({
    url: `underwater-sound/correlationJudgment/queryImportTable`,
    method: "get",
  });
}
// 查询左侧树结构数据 --1级
export function glpzGetLeftTreeData111Api() {
  return http({
    url: `underwater-sound/correlationJudgment/querySpecifiedDataType`,
    method: "get",
  });
}
export function rongheExportToDatabase(data) {
  return http({
    url: `underwater-sound/dataTableEntity/importResultDataToDatabase`,
    method: "post",
    data: data,
  });
}

// 右上一键清空
export function glpzClearLeftTreeListApi() {
  return http({
    url: `underwater-sound/correlationJudgment/cleanAllData`,
    method: "get",
  });
}

// 获取右侧table-data数据
export function glpzGetRightTableDataApi(query) {
  return http({
    url: `underwater-sound/correlationJudgment/queryTableDataList`,
    method: "get",
    params: query,
  });
}
// 获取右侧table的-row名
export function glpzGetRightTableRowApi(query) {
  return http({
    url: `underwater-sound/correlationJudgment/queryDataTableColumn`,
    method: "get",
    params: query,
  });
}

// 删除右侧表格的item
export function glpzRightTableItemDelApi(data) {
  return http({
    url: `underwater-sound/correlationJudgment/deleteTableData`,
    method: "post",
    data: data,
  });
}

// 更行修改右侧表格的item
export function glpzRightTableItemUpdateApi(data) {
  return http({
    url: `underwater-sound/correlationJudgment/updateImportTableData`,
    method: "post",
    data: data,
  });
}

// 查询表单交叉列以及对应的可能值
export function getTableIntersectionColumns(data) {
  return http({
    url: `underwater-sound/dataFilterAndFusion/getTableIntersectionColumns`,
    method: "post",
    data: data,
  });
}

export function glpzPzscSuanfaApi(data) {
  return http({
    url: `underwater-sound/correlationJudgment/executeCorrelationJudgment`,
    method: "post",
    data: data,
  });
}

export function getHotData(query) {
  return http({
    url: `underwater-sound/sse/heatmap`,
    method: "get",
    params: query,
  });
}

//根据算法id获得参数
export function getParams(query) {
  return http({
    url: `underwater-sound/dataAlgorithmsProcessing/getAlgorithmParams`,
    method: "get",
    params: query,
  });
}
//根据算法id获得参数
export function deleteCorrelationJudgmentHis(data) {
  return http({
    url: `underwater-sound/correlationJudgment/deleteCorrelationJudgmentHis`,
    method: "post",
    data: data,
  });
}
// 获取不知名-新增弹窗的 list
export function getXXXXTableListApi(query) {
  return http({
    url: `underwater-sound/dataEntity/queryUnstructuredData`,
    method: "get",
    params: query,
  });
}
export function getCenterLineChartData(data) {
  return http({
    url: `underwater-sound/dataAlgorithmsProcessing/executeFftCount`,
    method: "post",
    data,
  });
}
export function deleteRecord(query) {
  return http({
    url: `underwater-sound/dataAlgorithmsProcessing/deleteRecord`,
    method: "get",
    params: query,
  });
}
